package com.dongrj.framework.starter.log.converter;

import ch.qos.logback.classic.pattern.ClassicConverter;
import ch.qos.logback.classic.spi.ILoggingEvent;
import com.dongrj.framework.starter.log.constant.LogConstant;
import org.slf4j.TtlMDCAdapter;

/**
 * @author dongrongjun
 * @date 2020/08/04
 */
public class MDCClassicConverter extends ClassicConverter {

    @Override
    public String convert(ILoggingEvent iLoggingEvent) {
        return TtlMDCAdapter.getInstance().get(LogConstant.MDCField.TRACE_ID);
    }

}
